package com.liyunc.structure;


import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author liyuncong
 * @version 1.0
 * @file FileInMemory
 * @brief FileInMemory
 * @details FileInMemory
 * @date 2023-03-03
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-03-03                  liyuncong          Created
 */
public class FileInMemory {

    public static void main(String[] args) throws Exception {
//        ByteArrayOutputStream os = new ByteArrayOutputStream();
//        os.write(getContent());
//        final byte[] bytes = os.toByteArray();
//        InputStream inputStream = new ByteArrayInputStream(bytes);
//        System.out.println(inputStream.read(bytes));
        createFile();
    }

    public static byte[] getContent() {
        String content = "hello world";
        return content.getBytes();
    }

    public static void createFile() throws Exception {
        final Path file = Files.createFile(Paths.get(
            "D:\\codes\\liyuncong\\java-demo\\demo-structure\\src\\test\\java\\com\\liyunc\\structure",
            ".gitignore"));
    }


}
